<template>
  <div class="notification-container">
    <el-alert
      v-if="failureMessages.length > 0"
      title="有未处理的审核不通过事项"
      type="error"
      description="请前往处理"
      show-icon
    >
      <ul>
        <li v-for="message in failureMessages" :key="message.id">
          {{ message.yuLiuE }}
        </li>
      </ul>
    </el-alert>
  </div>
</template>

<script>
import { listEng } from "@/api/system/eng"; // 请确保导入的路径正确

export default {
  data() {
    return {
      failureMessages: []
    };
  },
  created() {
    // 从后端获取审核不通过的详细信息
    this.getFailureMessages();
  },
  methods: {
    getFailureMessages() {
      const query = { yuLiuB: -1 }; // 查询参数，yuLiuB = -1 表示审核不通过
      listEng(query).then(response => {
        this.failureMessages = response.rows;
      }).catch(error => {
        this.$message.error("获取审核不通过信息失败：" + error);
      });
    }
  }
};
</script>

<style scoped>
.notification-container {
  margin: 10px;
}
</style>
